Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ 7์ฃผ์ฐจ-TS/Recoil] โค๏ธ๐Ÿ’›๐Ÿ’š ์งฑ๊ตฌ๋Š” ๋ชป๋ง๋ ค! ๐Ÿ’š๐Ÿ’›โค๏ธ #9

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

iamphj3
Copy link
Contributor

@iamphj3 iamphj3 commented Jun 7, 2023

โœจ ๊ตฌํ˜„ ๊ธฐ๋Šฅ ๋ช…์„ธ

๊ธฐ์กด 3์ฃผ์ฐจ ๊ณผ์ œ๋ฅผ TS๋กœ ๊ตฌํ˜„ํ–ˆ์—ˆ์–ด์„œ, Recoil ์ ์šฉ๋งŒ ์ถ”๊ฐ€ํ•ด์„œ ๋ฆฌํŒฉํ† ๋งํ–ˆ์Šต๋‹ˆ๋‹ค!
๊ทธ๋ฆฌ๊ณ  ๋‚œ์ด๋„ ์„ ํƒ Button์„ ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ๋กœ ๋ถ„๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค.
์†Œ์Šค์ฝ”๋“œ ์„ค๋ช…์€ #7 ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”!


๐ŸŒผ PR Point

  • ๋ชจ๋“œ, ์ ์ˆ˜๋ฅผ ๋ฆฌ์ฝ”์ผ์„ ํ†ตํ•œ ์ „์—ญ์ƒํƒœ๋กœ ๊ด€๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค.
import { atom } from 'recoil';

import { EASY_MODE } from '../datas/mode';

export const ModeState = atom<number>({
  key: 'Mode',
  default: EASY_MODE,
});

export const ScoreState = atom<number>({
  key: 'Score',
  default: 0,
});
  const [mode, setMode] = useRecoilState(ModeState);
  const [score, setScore] = useRecoilState(ScoreState);
  • ์นด๋“œ ๋ฆฌ์ŠคํŠธ ๊ฐ์ฒด ๋ฐฐ์—ด์˜ ํƒ€์ž…์€ Zzangu ์ธํ„ฐํŽ˜์ด์Šค๋กœ ์„ ์–ธํ•˜๊ณ , ์ด๋ฅผ ์ƒ์†๋ฐ›์•„์„œ ๊ฒŒ์ž„ ์ง„ํ–‰ ์‹œ ํ•„์š”ํ•œ ๊ฐ’๋“ค์„ ์ถ”๊ฐ€ํ•œCardData ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์„ ์–ธํ•˜์˜€์Šต๋‹ˆ๋‹ค.
export interface Zzangu {
  id: number;
  src: string;
  alt: string;
}

const ZZANGU_LIST: Zzangu[] = [
  {
    id: 1,
    src: ImgZzangu01,
    alt: '์งฑ๊ตฌ1',
  },
]

interface CardData extends Zzangu {
  answer: number;
  flipped: boolean;
  matched: boolean;
}

๐Ÿฅบ ์†Œ์š” ์‹œ๊ฐ„, ์–ด๋ ค์› ๋˜ ์ 

  • ์—†์Šต๋‹ˆ๋‹ค!

๐ŸŒˆ ๊ตฌํ˜„ ๊ฒฐ๊ณผ๋ฌผ

https://zzangu.vercel.app/

@iamphj3 iamphj3 requested review from Arooming and SynthiaLee June 7, 2023 05:14
@iamphj3 iamphj3 self-assigned this Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant